
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>用户登陆</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">

	<script type="text/javascript" src="js/my.js"></script>
	<SCRIPT FOR=Abcde language=javascript EVENT=Receive()>
	alert("recevice");
	</script>
	
	
	<script type="text/javascript">
	
	Ext.onReady(function() {
	
	//Ext.BLANK_IMAGE_URL="js/extjs/3.0/resources/images/default/s.gif";
	Ext.QuickTips.init();

		var txt_userid = new Ext.form.TextField({
						fieldLabel : "用户帐号",
						name : "f_userid",
						id : "userno",
						allowBlank : false,
						blankText : "用户名不能为空，请填写！"
						//anchor : "90%"
					});
					
		var txt_userpasswd = new Ext.form.TextField({
				fieldLabel : "用户密码",
				inputType : "password",
				name : "f_password",
				id : "pwd",
				allowBlank : false,
				blankText : "用户密码不能为空，请填写！"
				//anchor : "90%"
			});			

	var loginPanel = new Ext.form.FormPanel
	(
	{
		title : "用户登录",
		id : "loginpanel",
		frame : true,
		width : 420,
		renderTo : "login_field",
		items : 
		[
			{
				xtype : "fieldset",
				title : "用户登录",
				collapsible : false,
				autoHeight : true,
				width : 300,
				defaults : 
				{
					width : 160
				},
				defaultType : "textfield",
				style : "text-align:left",
				items : 
				[
				        
					//company	,
					//usertype,	
			      	txt_userid, 
					txt_userpasswd
				]
			}
		],
		buttons : 
		[
				{
					xtype : "button",
					text : '登录',
					//cls : "x-btn-text-icon",
					clearCls : 'allow-float',
					itemCls : 'float-left',
					handler : function() 
					{
						
						if (loginPanel.form.isValid()) 
						{
							loginPanel.form.submit(
							{
								url : 'Json/LoginAction!login',
								success : function(from, action) 
								{
									var cp2 = new Ext.state.CookieProvider();     
									cp2.set('userid',txt_userid.getValue());
									//alert(txt_userid.getValue());     
							
										Ext.get('loginpanel').remove();
										//window.location.href = 'recordtest.jsp';
										window.location.href = 'index.jsp';

									
								},
								failure : function(form, action) 	
								{
									Ext.MessageBox.show
									({
										title : "登录失败",
										msg : "请确保用户名和密码输入正确！",
										icon : Ext.MessageBox.ERROR,
										buttons : {"ok" : "确定"}
									});
								},
								waitMsg : '正在登录...'
							})
						}
						else 
						{
							Ext.MessageBox.show
							({
									title : "警告",
									msg : "请填写完登录信息再提交!",
									icon : Ext.MessageBox.WARNING,
									buttons : {"ok" : "确定"}
							});
							
						}
						
					}
				},
				{
						xtype : "button",
						text : '重置',
						//cls : "x-btn-text-icon",
						//icon:"images/reset_btn.gif",
						clearCls : 'allow-float',
						itemCls : 'float-left',
						handler : function() 
						{
							
							loginPanel.form.reset();
						}
				}
			]
		
	});
});
	</script>
	
	
  </head>
  
  <body>
   <body bgcolor="skyblue">
  	<br />
  	<br />
  	<br />
  	<br />
  	<br />
  	<br />
  	<center>
  	  <div id="login_field"></div>
  	</center>
  </body>
  </body>
</html>
